//
//  TYSwitchView.h
//  TYUIKit_Example
//
//  Created by 谢航宇_WORK on 2022/3/17.
//  Copyright © 2022 谢航宇. All rights reserved.
//

#import <UIKit/UIKit.h>
@class TYSwitchView;
NS_ASSUME_NONNULL_BEGIN

typedef enum  : NSUInteger {
    ///平均分配
    TYSwitchViewSeparatorTypeDivide = 0,
    ///自适应尺寸，仅适用于默认格式
    TYSwitchViewSeparatorTypeAutoSize,
    ///自定义尺寸
    TYSwitchViewSeparatorTypeCustom,
} TYSwitchViewSeparatorType;

@protocol TYSwitchViewDelegate <NSObject>
- (NSInteger)numberOfRowOfSwitchHeaderView:(TYSwitchView *)headerView;
- (NSAttributedString *)switchHeaderView:(TYSwitchView *)headerView titleForRow:(NSInteger)row isSelected:(BOOL)selected;
- (void)switchHeaderView:(TYSwitchView *)headerView backgroundView:(UIImageView *)backgroundView forRow:(NSInteger)row isSelected:(BOOL)selected;
@end

@interface TYSwitchView : UIView
@property (nonatomic,copy) void(^selectComplete)(NSInteger index , BOOL repeatChoose);
@property (nonatomic,assign) NSInteger index;
@property (nonatomic,assign) TYSwitchViewSeparatorType type;
@property (nonatomic,weak) id <TYSwitchViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout> delegate;
- (void)reloadData;
- (void)registerClass:(nullable Class)cellClass forCellWithReuseIdentifier:(NSString *)identifier;
@end

NS_ASSUME_NONNULL_END
